True Separate Compilation for SML]

نویسنده

  • Liu Bochao
چکیده

In current days, separate compilation plays a very important role in the practical program development. As the name “separate compilation” indicates, it allows that the program is split into several source files. Each of them is self-contained in the sense it describes the import signature which are assumed to be provided by other code fragment and its own export declarations. Each unit can be compiled independently and then linked together as a whole. [1] proposes such an simple but elegant framework to describe the semantics of separate compilation and linking. Given a code fragment with the explicit import interface called linkset, it is compiled to a self-contained entity called intra-checking and then compatible modules can be safely linked together called inter-checking. As for the SML language, many SML compilers support the so-called incremental recompilation system such as the SML/NJ [2] and MLKit[3]. In these compiler systems, the compilation of the source files must be compiled incrementally. The interface of each source file is inferred automatically by the compiler without the interference of programmer. But a weak point of such strategy is that compiler always needs to know the implementation which imposes a really inconvenient situation in practical development. Imagine the following scenario: A and B cooperates to develop a software system and B depends on A. Without the implementation of A, B cannot do any real development. This is a serious obstacle to apply SML language into large scale software development. The ML dialect, Ocaml proposes a solution for cut-off separate compilation[4]. In Objective Caml, compilation units are regarded as a basic unit to be independently compiled and linked later. And each can be seen as special cases of structures and signatures, and the relationship between the units can be explained easily in terms of the ML module system. We use the example given in [4] to illustrate. A compilation unit A comprises two files: implementation file A.ml, consisting a sequence of definitions, analogous to the inside of a struct . . . end construct; interface file A.mli, which contains a sequence of specifications, analogous to the inside of a sig . . . end construct. Both files define a structure named A as if the following definition was entered at top-level as follows:

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Hierarchical Modularity and Intermodule Optimization

Separate compilation is an important tool for coping with design complexity in large software projects. When done right it can also be used to create software libraries, thus promoting code reuse. But separate compilation comes in various flavors and has many facets: namespace management, linking, optimization, dependencies. Many programming languages identify modular units with units of compil...

متن کامل

Incremental Recompilation for Standard ML of New Jersey

The design and implementation of an incremental recompilation manager (IRM) for Standard ML of New Jersey (SML/NJ) is described. Truly separate compilation is diicult to implement correctly and eeciently for SML because one compilation unit may depend not only on the interface of another, but also on its implementation. In this paper we present an integrated compilation system based on the \vis...

متن کامل

Thesis Proposal: Data Representations and Polymorphic Languages

Languages that provide polymorphism tend to place restrictions on object representations, separate compilation, and/or performance. For instance, most Ada implementations require that polymorphism be resolved before compilation. Consequently, separate compilation is sacriiced, since eliminating poly-morphism is a cross-module transformation. Some languages, like C++ and Modula-3, restrict the r...

متن کامل

Compiling with Types

Compilers for monomorphic languages, such as C and Pascal, take advantage of types to determine data representations, alignment, calling conventions, and register selection. However, these languages lack important features including polymorphism, abstract datatypes, and garbage collection. In contrast, modern programming languages such as Standard ML (SML), provide all of these features, but ex...

متن کامل

A Compilation Manager for Standard ML of New Jersey

The design and implementation of a compilation manager (CM) for Standard ML of New Jersey (SML/NJ) is described. Truly independent compilation is difficult to implement correctly and efficiently for SML because one compilation unit may depend not only on the interface of another, but also on its implementation. In this paper we present an integrated compilation system based on the “visible comp...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007